#include "../../../common/asrer.hpp"
#include <gflags/gflags.h>
//     // 设置APPID/AK/SK
//     std::string app_id = "115700399";                            // 设置你的 App ID
//     std::string api_key = "dQxbFnm7JEOIvKLPr4BVk7kY";            // 设置你的 Api key
//     std::string secret_key = "6yT6booHpHsogsVmwvzH1qM7OLBpNsT0"; // 设置你的 Secret Key

DEFINE_string(app_id, "115700399", "百度语音识别服务的服务id");
DEFINE_string(api_key_id, "dQxbFnm7JEOIvKLPr4BVk7kY", "百度语音识别服务的密钥ID");
DEFINE_string(api_key_secret, "6yT6booHpHsogsVmwvzH1qM7OLBpNsT0", "百度语音识别服务的密钥");

DEFINE_bool(log_mode, false, "程序的运行模式: true-发布模式 false-调试模式");
DEFINE_string(log_file, "", "发布模式下，制定日志的输出文件");
DEFINE_int32(log_level, 0, "发布模式下，制定日志的输出等级");

int main(int argc, char *argv[])
{
    google::ParseCommandLineFlags(&argc, &argv, true);
    bite_im::initLogger(FLAGS_log_mode, FLAGS_log_file, FLAGS_log_level);
    bite_im::AsrClient client(FLAGS_app_id, FLAGS_api_key_id, FLAGS_api_key_secret);
    std::string file_name = "test.pcm";
    std::string file_content;
    // aip::get_file_content("listen.pcm", &file_content);  // 也是报错
    aip::get_file_content(file_name.c_str(), &file_content);
    std::string err;
    std::cout << client.recognize(file_content, err) << std::endl;
}